/**
 * 项目名：五位一体化工安全信息平台
 * 日期：    2019-12-10 08:35:30
 * Copyright (c) 2015- joysuch-版权所有
 */

package com.joysuch.wwyt.bp.entity;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.Proxy;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

import static javax.persistence.GenerationType.IDENTITY;

@EntityListeners({AuditingEntityListener.class, AutoSetCommonFieldListener.class})
@Entity
@Table(name = "wwyt_bp_work_safety_cert")
@SQLDelete(sql = "update wwyt_bp_work_safety_cert set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update wwyt_bp_work_safety_cert set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")
@Proxy(lazy = false)
public class BpWorkSafetyCert implements java.io.Serializable {

    // columns START
    // ID
    private Long id;
    // 作业证编号
    private String code;
    // 作业类型
    private String type;
    // 作业级别
    private Integer workLevel;
    // 作业开始时间
    private java.util.Date startTime;
    // 作业结束时间
    private java.util.Date endTime;
    // 申请日期
    private java.util.Date applyTime;
    // 状态
    private Integer state;
    // 申请单位
    private Long applyDepartId;
    // 申请人
    private Long applyUserId;
    // 作业地点
    private String locationCoords;
    // 作业内容
    private String workContent;
    // 所属风险区域
    private Long riskDistrictId;
    // 监护人
    private String monitorUserCode;
    // 实施安全教育人
    private String educationUserCode;
    // 风险点
    private Long riskPointId;
    // 风险级别
    private Integer riskLevel;
    // 附件ID
    private Long attachmentId;
    // 危害辨识
    private String dangerRecoganize;
    // 编制人
    private Long editUserId;
    // 涉及的其他特殊行业
    private String otherSpecialWorkId;
    // 审核人
    private Long auditUserId;
    // 审核时间
    private java.util.Date auditTime;
    // 审核信息
    private String auditMsg;
    // 验收状态
    private Integer checkState;
    // 验收人
    private Long checkUserId;
    // 验收时间
    private java.util.Date checkTime;
    // 验收备注
    private String checkRemark;
    // 作业其他信息内容字段（JSON格式）
    private String workOtherInfoEntityJson;
    // 租户ID
    private Long tenentId;
    // 组织机构代码
    private String orgCode;
    // columns END

    // 2019年12月13日 申华要求添加字段
    // 是否需用电申请签单
    private String needEletricityApplySheet;
    // 工具名称
    private String workToolName;
    // 2019年12月13日 申华要求添加字段 -- 结束

    // 2019年12月15日11:58
    // jha评估ID
    private Long jhaEvaluationId;
    // 作业已结束
    private Integer jobFinished;
    // 设置报警
    private String alarm;
    // 删除标记
    private String deleteFlag;

    //申请人证书idjson
    private String applyUserCertIdJson;
    //监护人证书idjson
    private String monitorUserCertIdJson;
    //实施安全教育人证书idjson
    private String educationUserCertIdJson;
    //编制人证书idjson
    private String editUserCertIdJson;

    //作业证特有的人员证书json
    private String workOtherUserCertIdJson;

    //人员是否是公司人员还是承包商json(0公司,1承包商)
    private String peopleTypeJson;

    //作业单位负责人完工确认情况
    private String unitOpinion;

    //生产车间(分厂)负责人完工确认情况
    private String workshopOpinion;

    //签批日期
    private Date signatureTime;

    //作业地点-手动输入
    private String jobSite;

    @org.springframework.data.annotation.CreatedBy
    @ApiModelProperty("创建人")
    private Long createBy;

    @org.springframework.data.annotation.CreatedDate
    @ApiModelProperty("创建时间")
    private Date createTime;

    @org.springframework.data.annotation.LastModifiedBy
    @ApiModelProperty("更新人")
    private Long updateBy;

    @org.springframework.data.annotation.LastModifiedDate
    @ApiModelProperty("更新时间")
    private Date updateTime;

    @Column(name = "job_site")
    public String getJobSite() {
        return jobSite;
    }

    public void setJobSite(String jobSite) {
        this.jobSite = jobSite;
    }

    @Column(name = "signature_time")
    public Date getSignatureTime() {
        return signatureTime;
    }

    public void setSignatureTime(Date signatureTime) {
        this.signatureTime = signatureTime;
    }

    @Column(name = "unit_opinion")
    public String getUnitOpinion() {
        return unitOpinion;
    }

    public void setUnitOpinion(String unitOpinion) {
        this.unitOpinion = unitOpinion;
    }

    @Column(name = "workshop_opinion")
    public String getWorkshopOpinion() {
        return workshopOpinion;
    }

    public void setWorkshopOpinion(String workshopOpinion) {
        this.workshopOpinion = workshopOpinion;
    }

    public String getWorkOtherUserCertIdJson() {
        return workOtherUserCertIdJson;
    }

    public void setWorkOtherUserCertIdJson(String workOtherUserCertIdJson) {
        this.workOtherUserCertIdJson = workOtherUserCertIdJson;
    }

    public String getApplyUserCertIdJson() {
        return applyUserCertIdJson;
    }

    public void setApplyUserCertIdJson(String applyUserCertIdJson) {
        this.applyUserCertIdJson = applyUserCertIdJson;
    }

    public String getMonitorUserCertIdJson() {
        return monitorUserCertIdJson;
    }

    public void setMonitorUserCertIdJson(String monitorUserCertIdJson) {
        this.monitorUserCertIdJson = monitorUserCertIdJson;
    }

    public String getEducationUserCertIdJson() {
        return educationUserCertIdJson;
    }

    public void setEducationUserCertIdJson(String educationUserCertIdJson) {
        this.educationUserCertIdJson = educationUserCertIdJson;
    }

    public String getEditUserCertIdJson() {
        return editUserCertIdJson;
    }

    public void setEditUserCertIdJson(String editUserCertIdJson) {
        this.editUserCertIdJson = editUserCertIdJson;
    }

    @Column(name = "ALARM", length = 1000)
    public String getAlarm() {
        return alarm;
    }

    public void setAlarm(String alarm) {
        this.alarm = alarm;
    }

    @Column(name = "DELETE_FLAG", length = 1)
    public String getDeleteFlag() {
        return deleteFlag;
    }

    public void setDeleteFlag(String deleteFlag) {
        this.deleteFlag = deleteFlag;
    }

    public void setId(Long value) {
        this.id = value;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }

    @Column(name = "CODE")
    public String getCode() {
        return this.code;
    }

    public void setCode(String value) {
        this.code = value;
    }

    @Column(name = "TYPE", length = 4)
    public String getType() {
        return this.type;
    }

    public void setType(String value) {
        this.type = value;
    }

    @Column(name = "WORK_LEVEL")
    public Integer getWorkLevel() {
        return this.workLevel;
    }

    public void setWorkLevel(Integer value) {
        this.workLevel = value;
    }

    @Column(name = "START_TIME")
    public java.util.Date getStartTime() {
        return this.startTime;
    }

    public void setStartTime(java.util.Date value) {
        this.startTime = value;
    }

    @Column(name = "END_TIME")
    public java.util.Date getEndTime() {
        return this.endTime;
    }

    public void setEndTime(java.util.Date value) {
        this.endTime = value;
    }

    @Column(name = "APPLY_TIME")
    public java.util.Date getApplyTime() {
        return this.applyTime;
    }

    public void setApplyTime(java.util.Date value) {
        this.applyTime = value;
    }

    @Column(name = "STATE")
    public Integer getState() {
        return this.state;
    }

    public void setState(Integer value) {
        this.state = value;
    }

    @Column(name = "APPLY_DEPART_ID")
    public Long getApplyDepartId() {
        return this.applyDepartId;
    }

    public void setApplyDepartId(Long value) {
        this.applyDepartId = value;
    }

    @Column(name = "APPLY_USER_ID")
    public Long getApplyUserId() {
        return this.applyUserId;
    }

    public void setApplyUserId(Long value) {
        this.applyUserId = value;
    }

    @Column(name = "LOCATION_COORDS")
    public String getLocationCoords() {
        return this.locationCoords;
    }

    public void setLocationCoords(String value) {
        this.locationCoords = value;
    }

    @Column(name = "WORK_CONTENT")
    public String getWorkContent() {
        return this.workContent;
    }

    public void setWorkContent(String value) {
        this.workContent = value;
    }

    @Column(name = "RISK_DISTRICT_ID")
    public Long getRiskDistrictId() {
        return this.riskDistrictId;
    }

    public void setRiskDistrictId(Long value) {
        this.riskDistrictId = value;
    }

    @Column(name = "MONITOR_USER_CODE")
    public String getMonitorUserCode() {
        return this.monitorUserCode;
    }

    public void setMonitorUserCode(String value) {
        this.monitorUserCode = value;
    }

    @Column(name = "EDUCATION_USER_CODE")
    public String getEducationUserCode() {
        return this.educationUserCode;
    }

    public void setEducationUserCode(String value) {
        this.educationUserCode = value;
    }

    @Column(name = "RISK_POINT_ID")
    public Long getRiskPointId() {
        return this.riskPointId;
    }

    public void setRiskPointId(Long value) {
        this.riskPointId = value;
    }

    @Column(name = "RISK_LEVEL")
    public Integer getRiskLevel() {
        return this.riskLevel;
    }

    public void setRiskLevel(Integer value) {
        this.riskLevel = value;
    }

    @Column(name = "ATTACHMENT_ID")
    public Long getAttachmentId() {
        return this.attachmentId;
    }

    public void setAttachmentId(Long value) {
        this.attachmentId = value;
    }

    @Column(name = "DANGER_RECOGANIZE")
    public String getDangerRecoganize() {
        return this.dangerRecoganize;
    }

    public void setDangerRecoganize(String value) {
        this.dangerRecoganize = value;
    }

    @Column(name = "EDIT_USER_ID")
    public Long getEditUserId() {
        return this.editUserId;
    }

    public void setEditUserId(Long value) {
        this.editUserId = value;
    }

    @Column(name = "OTHER_SPECIAL_WORK_ID")
    public String getOtherSpecialWorkId() {
        return this.otherSpecialWorkId;
    }

    public void setOtherSpecialWorkId(String value) {
        this.otherSpecialWorkId = value;
    }

    @Column(name = "AUDIT_USER_ID")
    public Long getAuditUserId() {
        return this.auditUserId;
    }

    public void setAuditUserId(Long value) {
        this.auditUserId = value;
    }

    @Column(name = "AUDIT_TIME")
    public java.util.Date getAuditTime() {
        return this.auditTime;
    }

    public void setAuditTime(java.util.Date value) {
        this.auditTime = value;
    }

    @Column(name = "AUDIT_MSG")
    public String getAuditMsg() {
        return this.auditMsg;
    }

    public void setAuditMsg(String value) {
        this.auditMsg = value;
    }

    @Column(name = "CHECK_STATE")
    public Integer getCheckState() {
        return this.checkState;
    }

    public void setCheckState(Integer value) {
        this.checkState = value;
    }

    @Column(name = "CHECK_USER_ID")
    public Long getCheckUserId() {
        return this.checkUserId;
    }

    public void setCheckUserId(Long value) {
        this.checkUserId = value;
    }

    @Column(name = "CHECK_TIME")
    public java.util.Date getCheckTime() {
        return this.checkTime;
    }

    public void setCheckTime(java.util.Date value) {
        this.checkTime = value;
    }

    @Column(name = "CHECK_REMARK")
    public String getCheckRemark() {
        return this.checkRemark;
    }

    public void setCheckRemark(String value) {
        this.checkRemark = value;
    }

    @Column(name = "WORK_OTHER_INFO_ENTITY_JSON")
    public String getWorkOtherInfoEntityJson() {
        return this.workOtherInfoEntityJson;
    }

    public void setWorkOtherInfoEntityJson(String value) {
        this.workOtherInfoEntityJson = value;
    }

    @Column(name = "TENENT_ID")
    public Long getTenentId() {
        return this.tenentId;
    }

    public void setTenentId(Long value) {
        this.tenentId = value;
    }

    @Column(name = "ORG_CODE", length = 100)
    public String getOrgCode() {
        return this.orgCode;
    }

    public void setOrgCode(String value) {
        this.orgCode = value;
    }

    @Column(name = "NEED_ELETRICITY_APPLY_SHEET")
    public String getNeedEletricityApplySheet() {
        return needEletricityApplySheet;
    }

    public void setNeedEletricityApplySheet(String needEletricityApplySheet) {
        this.needEletricityApplySheet = needEletricityApplySheet;
    }

    @Column(name = "WORK_TOOL_NAME")
    public String getWorkToolName() {
        return workToolName;
    }

    public void setWorkToolName(String toolName) {
        this.workToolName = toolName;
    }

    @Column(name = "JHA_EVALUATION_ID")
    public Long getJhaEvaluationId() {
        return jhaEvaluationId;
    }

    public void setJhaEvaluationId(Long jhaEvaluationId) {
        this.jhaEvaluationId = jhaEvaluationId;
    }

    @Column(name = "JOB_FINISHED")
    public Integer getJobFinished() {
        return jobFinished;
    }

    @Column(name = "people_type_json")
    public String getPeopleTypeJson() {
        return peopleTypeJson;
    }

    public void setPeopleTypeJson(String peopleCategoryJson) {
        this.peopleTypeJson = peopleCategoryJson;
    }

    public void setJobFinished(Integer jobFinished) {
        this.jobFinished = jobFinished;
    }

    public Long getCreateBy() {
        return createBy;
    }

    public void setCreateBy(Long createBy) {
        this.createBy = createBy;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Long getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(Long updateBy) {
        this.updateBy = updateBy;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }


    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId()).append("code", getCode())
                .append("type", getType()).append("workLevel", getWorkLevel()).append("startTime", getStartTime())
                .append("endTime", getEndTime()).append("applyTime", getApplyTime()).append("state", getState())
                .append("applyDepartId", getApplyDepartId()).append("applyUserId", getApplyUserId())
                .append("locationCoords", getLocationCoords()).append("workContent", getWorkContent())
                .append("riskDistrictId", getRiskDistrictId()).append("monitorUserCode", getMonitorUserCode())
                .append("educationUserCode", getEducationUserCode()).append("riskPointId", getRiskPointId())
                .append("riskLevel", getRiskLevel()).append("attachmentId", getAttachmentId()).append("jobSite", getJobSite())
                .append("dangerRecoganize", getDangerRecoganize()).append("editUserId", getEditUserId())
                .append("otherSpecialWorkId", getOtherSpecialWorkId()).append("auditUserId", getAuditUserId())
                .append("auditTime", getAuditTime()).append("auditMsg", getAuditMsg())
                .append("checkState", getCheckState()).append("checkUserId", getCheckUserId())
                .append("checkTime", getCheckTime()).append("checkRemark", getCheckRemark())
                .append("workOtherInfoEntityJson", getWorkOtherInfoEntityJson()).append("peopleTypeJson", getPeopleTypeJson()).append("tenentId", getTenentId())
                .append("unitOpinion", getUnitOpinion()).append("workshopOpinion", getWorkshopOpinion()).append("orgCode", getOrgCode()).toString();
    }

    public int hashCode() {
        return new HashCodeBuilder().append(getId()).toHashCode();
    }

    public boolean equals(Object obj) {
        if (obj instanceof BpWorkSafetyCert == false)
            return false;
        if (this == obj)
            return true;
        BpWorkSafetyCert other = (BpWorkSafetyCert) obj;
        return new EqualsBuilder().append(getId(), other.getId()).isEquals();
    }
}
